﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas0a00
    {
        private int? _valuecode;
		private string _valuename;
		private string _muser;
		
        /// <summary>
        /// 状态代码
        /// </summary>
		public int? Valuecode
		{
			get { return _valuecode;	 }
			set { _valuecode=value;	}
		}
        /// <summary>
        /// 状态描述
        /// </summary>
		public string Valuename
		{
			get { return _valuename;	 }
			set { _valuename=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
		
		public static List<Bas0a00> GetBas0a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas0a00> list = new List<Bas0a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas0a00 model = GetBas0a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas0a00 GetBas0a00ByDataRow(DataRow dr)
		{
			Bas0a00 model = new Bas0a00(); //实例化Bas0a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("valuecode")&&!(dr["valuecode"] is System.DBNull))  
				model.Valuecode = ( int)dr["valuecode"];
			if (dcc.Contains("valuename")&&!(dr["valuename"] is System.DBNull))  
				model.Valuename = ( string)dr["valuename"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			
			return model;
		}
    }
}
